//
//  upTableViewCell.m
//  INAlienLand
//
//  Created by dllo on 15/7/13.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "upTableViewCell.h"
#define WIDTH self.contentView.frame.size.width
#define HEIGHT self.contentView.frame.size.height
@implementation upTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.leftImageView = [[UIImageView alloc] init];
        [self.contentView addSubview:self.leftImageView];
        [_leftImageView release];
        
        self.titleLabel = [[UILabel alloc] init];
        self.titleLabel.font = [UIFont systemFontOfSize:18];
        [self.contentView addSubview:self.titleLabel];
        [_titleLabel release];
        
        self.pretitleLabel = [[UILabel alloc] init];
        self.pretitleLabel.font = [UIFont systemFontOfSize:14];
        [self.contentView addSubview:self.pretitleLabel];
        [_pretitleLabel release];
        
        self.subtitleLabel = [[UILabel alloc] init];
        self.subtitleLabel.font = [UIFont systemFontOfSize:14];
        [self.contentView addSubview:self.subtitleLabel];
        [_subtitleLabel release];
    }
    return self;
}

- (void)layoutSubviews{
    [super layoutSubviews];
    self.leftImageView.frame = CGRectMake(0, 0, WIDTH / 5, HEIGHT);
//    self.leftImageView.layer.borderWidth = 1;
    //隐藏多余部分
//    self.leftImageView.layer.masksToBounds = YES;
    
    self.pretitleLabel.frame = CGRectMake(WIDTH / 5, 0, WIDTH / 5 * 4, HEIGHT / 3);
    
    self.titleLabel.frame = CGRectMake(WIDTH / 5, HEIGHT / 3, WIDTH / 5 * 4, HEIGHT / 3);
    
    self.subtitleLabel.frame = CGRectMake(WIDTH / 5, HEIGHT / 3 * 2, WIDTH / 5 * 4, HEIGHT / 3);
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
